//
//  YDMyHeaderView.m
//  YDTestDrive
//
//  Created by ios on 2017/2/14.
//  Copyright © 2017年 ios. All rights reserved.
//

#import "YDMyHeaderView.h"
#import "YDMyInfoModel.h"

#import "UIImageView+WebCache.h"

@interface YDMyHeaderView ()


@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;
@property (weak, nonatomic) IBOutlet UILabel *memberLabel;
@property (weak, nonatomic) IBOutlet UILabel *positionLabel;
@property (weak, nonatomic) IBOutlet UILabel *todayDriveCountLabel;
@property (weak, nonatomic) IBOutlet UILabel *driveCustomerCountLabel;



@end
@implementation YDMyHeaderView


+ (instancetype)instanceMyHeaderView
{
    NSArray *nibArray = [[NSBundle mainBundle] loadNibNamed:@"YDMyHeaderView" owner:nil options:nil];
    return nibArray.firstObject;
}

- (void)setMyInfoModel:(YDMyInfoModel *)myInfoModel
{
    _myInfoModel = myInfoModel;
    
    [self.iconImageView sd_setImageWithURL:[NSURL URLWithString:myInfoModel.headPic] placeholderImage:[UIImage imageNamed:@"head_boy"]];
    
    self.memberLabel.text = myInfoModel.memberName;
    
    self.positionLabel.text = myInfoModel.jobTitle;
    
    self.todayDriveCountLabel.text = [NSString stringWithFormat:@"%@", myInfoModel.todayTestDrive];
    
    self.driveCustomerCountLabel.text = [NSString stringWithFormat:@"%@", myInfoModel.totalTestDrive];
    
}


@end
